#!/bin/bash

cd /usr/local/sphinx/bin 


num=`ps -ef | grep 'searchd' | grep -v 'grep searchd' |wc -l`

if [ $num -ne 1 ]; then

/usr/local/sphinx/bin/searchd --config /usr/local/sphinx/etc/sphinx.conf >> /usr/local/sphinx/var/log/sphinx-restart.log 2>&1

	echo `date` >>/usr/local/sphinx/var/log/sphinx-restart.log

else
	echo "process is online"


fi
